﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ICDA.Web.Models;

namespace ICDA.Web.Controllers
{
    public class NavController : Controller
    {
        //
        // GET: /Nav/

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Menu()
        {
            MenuViewModel menu = new MenuViewModel();
            if (Session["UID"] != null)
            {
                if (string.Equals(Session["Role"].ToString().Trim(), "Admin"))
                {
                    menu.IsAdmin = true;
                }
                else
                {
                    menu.IsAdmin = false;
                }
                menu.IsAuthenticated = true;
            }
            return View(menu);
        }
    }
}
